package graduation.service.Impl;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import graduation.dao.ApplyDao;
import graduation.entity.Apply;
import graduation.service.ApplyService;
@Service
@Transactional
public class ApplyServiceImpl implements ApplyService{
	@Autowired
	private ApplyDao ApplyDaoImpl;
	/**
	 * 申请
	 */
	@Override
	public void addApply(Apply apply) {
		// TODO Auto-generated method stub
		ApplyDaoImpl.addApply(apply);
	}
	/**
	 * 通过id查询
	 */
	@Override
	public Apply findById(Integer id) {
		// TODO Auto-generated method stub
		return ApplyDaoImpl.findById(id);
	}
	/**
	 * 修改
	 */
	@Override
	public void update(Apply apply) {
		// TODO Auto-generated method stub
		ApplyDaoImpl.update(apply);
	}
	/**
	 * 通过我的邮箱查询
	 */
	@Override
	public List<Apply> findBySender(String sender) {
		// TODO Auto-generated method stub
		List<Apply> list = ApplyDaoImpl.findBySender(sender);
		return list;
	}
	/**
	 * 通过收件人邮箱查询
	 */
	@Override
	public List findByReceiver(String receiver) {
		// TODO Auto-generated method stub
		List<Apply> list = ApplyDaoImpl.findByReceiver(receiver);
		return list;
	}
	/**
	 * 通过我的邮箱和批复状态获取所有申请
	 */
	@Override
	public List getMyApplyByStatus(String sender, Boolean dealStatus) {
		// TODO Auto-generated method stub
		List<Apply> list = ApplyDaoImpl.getMyApplyByStatus(sender,dealStatus);
		return list;
	}
	@Override
	public List findByUserId(String userId) {
		// TODO Auto-generated method stub
		return ApplyDaoImpl.findByUserId(userId);
	}
	//删除
	@Override
	public void delApplyById(int applyId) {
		// TODO Auto-generated method stub
		ApplyDaoImpl.delApplyById(applyId);
	}
	
}
